<%--
  Author: Cac
  Date: 2005-2-10
--%>
<%@ page contentType="text/html;charset=GBK"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
	<head>
		<style type="text/css">@import url('<c:url value="/components/calendar/skins/aqua/theme.css"/>');</style>
		<script type="text/javascript" src="<c:url value="/components/calendar/calendar.js"/>"></script>
		<script type="text/javascript" src="<c:url value="/components/calendar/calendar-setup.js"/>"></script>
		<script type="text/javascript" src="<c:url value="/components/calendar/lang/calendar-zh_CN.js"/>"></script>

	</head>
	<body bgcolor="f0f0f0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<div id="calendar-container" border="0"></div>
		<script type="text/javascript">
  var formName = '${param.form}';
  var fieldName = '${param.field}';

  function dateChanged(calendar)
  {
    // Beware that this function is called even if the end-user only
    // changed the month/year.  In order to determine if a date was
    // clicked you can use the dateClicked property of the calendar:
    if (calendar.dateClicked)
    {
      // OK, a date was clicked
      // Change the date in the calling page
      // Retrieve the form
      var form = window.opener.document.forms[formName];
      var element = form.elements[fieldName];
      element.value=calendar.date.print(calendar.params.ifFormat);

      window.close();

      window.opener.focus();
      element.focus();
    }
  };
  Calendar.setup(
    {
      flat         : "calendar-container", // ID of the parent element
      flatCallback : dateChanged,          // our callback function
      firstDay     : 0,                  // first day of the week
      ifFormat     : "%Y-%m-%d"  // our date only format
    }
  );
</script>
	</body>
</html>
